<template>
  <el-dialog
          @close="fn"
          :title="title"
          :visible.sync="isShow"
          :width="width">
    <slot></slot>
  </el-dialog>
</template>

<script lang="ts">
  import { Vue, Component, Prop, Emit } from 'vue-property-decorator'

  @Component({
    components: {}
  })
  export default class PlainDialog extends Vue {
    isShow: boolean = false
    @Prop() title: string
    @Prop({ default: '40%' }) width: string
    @Prop({
      default: () => () => {}
    }) close

    fn () {
      this.$emit('close')
    }

    openDialog () {
      this.isShow = true
    }

    closeDialog () {
      this.isShow = false
    }
  }
</script>
